package com.tapstitch.scm.pms.web.controller.system;

import com.bluebuck.sso.client.admin.auth.model.LoginUser;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhenyu.guo
 * @date 2024/5/21.
 */
public class HornbillLoginUser extends LoginUser {

    private List<RouterSystemView> systemRouters;


    public List<RouterSystemView> getSystemRouters() {
        return systemRouters;
    }

    public void setSystemRouters(List<RouterSystemView> systemRouters) {
        this.systemRouters = systemRouters;
    }

    public static class RouterSystemView {
        private Long id;
        private String name;
        private String path;
        /** 内存中暂存的path，用来记录递归产生的中间值 */
        private String nextPath;
        private List<RouterSystemView> children = new ArrayList<>();

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public List<RouterSystemView> getChildren() {
            return children;
        }

        public void setChildren(List<RouterSystemView> children) {
            this.children = children;
        }

        public String getNextPath() {
            return nextPath;
        }

        public void setNextPath(String nextPath) {
            this.nextPath = nextPath;
        }

        public void addChild(RouterSystemView view) {
            if (children == null) {
                children = new ArrayList<>();
            }
            children.add(view);
        }
    }

}
